\input{euler.tex}
\usepackage[utf8]{inputenc}

\newcommand{\vO}{\mathbf{O}}
\newcommand{\vP}{\mathbf{P}}

\begin{document}

\problem[363]{Bézier Curves}

A cubic Bézier curve, $\vP(x,y)$, is defined by four points $\vP_0$, $\vP_1$, $\vP_2$ and $\vP_3$ as
\[
\vP = (1-t)^3 \vP_0 + 3(1-t)^2 t \vP_1 + 3(1-t)t^2 \vP_2 + t^3 \vP_3
\]
where $0 \le t \le 1$.

In this problem, a cubic Bézier curve with $\vP_0(0,1)$, $\vP_1(v,1)$, $\vP_2(1,v)$ and $\vP_3(1,0)$ is used to approximate a quarter circle. The value $v > 0$ is chosen such that the area enclosed by the lines $\vO\vP_0$, $\vO\vP_3$ and the curve is equal to $\pi / 4$ (the area of the quarter circle).

By how many percent does the length of the curve differ from the length of the quarter circle? That is, if $L$ is the length of the curve, calculate $100 \times (L-\pi/2)/(\pi/2)$. Give your answer rounded to 10 digits behind the decimal point.

\solution

Substituting the coordinates of the points into the equation, we get
\begin{align}
x(t) &= 3(1-t)^2 t v + 3(1-t)t^2 + t^3 , \notag \\
y(t) &= (1-t)^3 + 3(1-t)^2 t + 3(1-t)t^2 v . \notag
\end{align}
It is useful to compute the following derivatives:
\begin{align}
x'(t) &=  3[v+2(1-2v)t + (3v-2) t^2 ]  \notag \\
y'(t) &= 3[2(v-1)t - (3v-2) t^2] . \notag
\end{align}

The area enclosed by the Bézier curve and the axes is
\[
\int_0^1 y dx = \int_0^1 y(t) x'(t) dt = -\frac{3}{20} v^2 + \frac{3}{5} v + \frac12
\]
after expanding and combining terms. Setting this to $\pi / 4$ and solving the quadratic equation, we get
\[
v = 2 - \sqrt{\frac{22 - 5\pi}{3}} \approx 0.55178.
\]
Plotting this Bézier curve along with the quarter circle shows that the approximation is so close that the two curves cannot be distinguished by the eye. (Hence there is no need to include the plot here.)

The length of the Bézier curve can be found by
\[
L = \int_C \sqrt{(dx)^2 + (dy)^2} = \int_0^1 \sqrt{ [x'(t)]^2 + [y'(t)]^2 } \, dt
\]
which is then computed by numerical integration.

\complexity

Time complexity: $\BigO(1)$

Space complexity: $\BigO(1)$

\answer

0.0000372091

\reference

http://en.wikipedia.org/wiki/B\%C3\%A9zier\_curve


\end{document} 